package se19team1e.controller;

import java.util.ArrayList;
import java.util.List;

import se19team1e.gui.BaseScreen;
import se19team1e.gui.MessageBox;
import se19team1e.gui.MessageBoxFactory;

/**
 * A mock MessageBoxFactory, used for testing.
 * 
 * @author lai shiaw san
 *
 */
public class MockMessageBoxFactory implements MessageBoxFactory {

    /**
     * A list of mock message boxes created.
     */
    private final List< MockMessageBox > messageBoxes = new ArrayList< MockMessageBox >();
    
    /* (non-Javadoc)
     * @see se19team1e.gui.IMessageBoxFactory#createMessageBox(se19team1e.gui.IBaseScreen)
     */
    @Override
    public MessageBox createMessageBox( BaseScreen parent ) {
        MockMessageBox messageBox = new MockMessageBox();
        
        this.messageBoxes.add( messageBox );
        
        return messageBox;
    }

    /**
     * Get the list of message boxes created.
     * @return List of message boxes created.
     */
    public List< MockMessageBox > getMessageBoxes() {
        return this.messageBoxes;
    }

    /**
     * Helper method to reset all values.
     */
    public void reset() {
        this.messageBoxes.clear();
    }
    
}
